package demo.service;

import demo.service.vo.CertRequest;
import demo.service.vo.CertResponse;

public class MakeCertService {

    public CertResponse makeCert(CertRequest request, boolean isDouble) {
        try {
            // 模拟业务延迟
            Thread.sleep(10);
        } catch (Exception ex) {
            ex.printStackTrace();
        }

        // 构造响应
        CertResponse response = new CertResponse();
        response.setId(request.getId());
        response.setName(request.getName());
        response.setSignCert("demo cert");
        if(isDouble) {
            response.setEncCert("NONE");
            response.setPrvKey("NONE");
        }

        return response;
    }
}
